package pira.db.excute;

import pira.db.ui.MinimumDBUI;
import pira.db.ui.SubDBUI;

public class GenerateMinimumDB {

	private SubDBUI sdbui;
	private MinimumDBUI mdbui;
	
	public GenerateMinimumDB() {
		this.sdbui = new SubDBUI();
		this.mdbui = new MinimumDBUI();
	}
	
	private void generateDB() {
		mdbui.generateMinimumDB(sdbui);
	}
	
	private void shutDown() {
		this.sdbui.shutDown();
		this.mdbui.shutDown();
	}
	
	public static void main(String[] args) {
		GenerateMinimumDB gmdb = new GenerateMinimumDB();
		long startTime = System.currentTimeMillis();
		gmdb.generateDB();
		long timePassed = (System.currentTimeMillis() - startTime)/1000;
		gmdb.shutDown();
		System.out.println("Program run " + timePassed + " seconds.");
	}

}
